<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
ini_set('memory_limit', '-1');
//Note:  Do not include the opening and closing PHP tags when you copy this code
?>
<?php
/**
 * Application config.
 */
 
final class Config {

    const USER_SESSION_VARIABLE = "user_session_name";
    const HOME_PAGE = 'index.php';
    const IMPORT_PAGE = 'import.php';
    const IMPORT_KEY = 'JYlOjo821t6fvSOvOM7H764mEV4BSNZt3XiqH2skDU';
    
    /** @var array config data */
    private static $data = null;
    

    public function __construct() {
        self::getData();
    }

    /**
     * @return array
     * @throws Exception
     */
    public static function getConfig($section = null) {
        if ($section === null) {
            return self::getData();
        }
        $data = self::getData();
        if (!array_key_exists($section, $data)) {
            throw new Exception('Unknown config section: ' . $section);
        }
        return $data[$section];
    }

    /**
     * @return array
     */
    public static function getData() {
        if (self::$data !== null) {
            return self::$data;
        }
        self::$data = parse_ini_file('config.ini', true);
        return self::$data;
    }

}
// session
        session_start();


include('config.php');
include('model/Contract.php');
include('model/Event.php');
include('model/SettledContract.php');
include('model/UserAccount.php');
include('model/Country.php');
include('model/League.php');
include('model/Setting.php');
include('util/Utils.php');
include('util/ImportUtils.php');
include('dao/DALBase.php');
include('dao/DALContract.php');
include('dao/DALEvent.php');
include('dao/DALSettledContract.php');
include('dao/DALUserAccount.php');
include('dao/DALCountry.php');
include('dao/DALLeague.php');
include('dao/DALConfig.php');


Utils::validateUser();

?>
